package com.atguigu.mapper;

import com.atguigu.base.BaseMapper;
import com.atguigu.entity.AdminRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AdminRoleMapper extends BaseMapper<AdminRole> {


    /**
     * 获取用户所拥有的角色的id集合
     * @param adminId
     * @return
     */
    List<Long> findRoleIdListByAdminId(Long adminId);

    /**
     * 删除原角色
     * @param adminId
     */
    void deleteByAdminId(Long adminId);


    /**
     * 为该用户重新分配角色
     * @param adminId
     * @param roleIds
     */
    void assignRole(@Param("adminId") Long adminId, @Param("roleIds") List<Long> roleIds);


}
